<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>成功加入购物车-小米商城</title>
<link rel="shortcut icon" href="img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/shopcarchage.css" />
<style type="text/css">
/* 头像 */
.thumFace{
	width: 28px;
    height: 28px;
    border-radius: 14px;
    vertical-align: -8px;
    margin-right: 15px;
}
</style>

</head>

<body>
	<div class="site-topbar">
		<div class="container">
			<div class="topbar-nav">
				<a rel="nofollow" href="index.jsp"> 小米商城 </a> <span class="sep">|</span>
				<a rel="nofollow" href="#" target="_blank"> MIUI </a> <span
					class="sep">|</span> <a rel="nofollow" href="#"> IoT </a> <span
					class="sep">|</span> <a rel="nofollow" href="#" target="_blank">
					云服务 </a> <span class="sep">|</span> <a rel="nofollow" href="#"
					target="_blank"> 金融 </a> <span class="sep">|</span> <a
					rel="nofollow" href="#" target="_blank"> 有品 </a> <span class="sep">|</span>
				<a rel="nofollow" href="#" target="_blank"> 小爱开放平台 </a> <span
					class="sep">|</span> <a rel="nofollow" href="#" target="_blank">
					政企服务 </a> <span class="sep">|</span> <a rel="nofollow" href="#">
					Select Region </a>
			</div>
			<div class="topbar-cart topbar-cart-filled" id="J_miniCartTrigger">
				<a rel="nofollow" class="cart-mini" id="J_miniCartBtn"
					href="shopping-car2.jsp"> <i class="iconfont"></i> 购物车 <span
					class="cart-mini-num J_cartNum">（1）</span>
				</a>

			</div>
			<div class="topbar-info" id="J_userInfo">
				<%
					String loginImg = (String) session.getAttribute("simg");
				 	if (loginImg != null) {
				 		String user = session.getAttribute("simg").toString();
				 		out.print("<img class = 'thumFace' src='"+loginImg+"'>");
				 	} 
				%>
				<%
					String loginName = (String) session.getAttribute("sname");
					String loginTel = (String) session.getAttribute("stel");
					if (loginName != null) {
						// 用户已登录
						String user = session.getAttribute("sname").toString();
						out.print("<a href = 'userinfo.jsp' id = 'userInfo'>" + user + "<a/>");
						out.print("<span> |</span> ");
						out.print("<a href='logout.jsp'>退出</a> ");
					} else if (loginTel != null) {
						// 用户已登录
						String user = session.getAttribute("stel").toString();
						out.print("<a href = 'userinfo.jsp' id = 'userInfo'>" + user + "<a/>");
						out.print("<span>|</span> ");
						out.print("<a href='logout.jsp'>退出</a> ");
					} else {
						// 用户未登录
						out.print("<a href='loading.jsp' id = 'userName'>登录</a>");
						out.print("<span>|</span> ");
						out.print("<a href='register.jsp'>注册</a> ");
					}
				%>
			</div>
		</div>
	</div>
	<div class="site-header">
		<div class=container>
			<div class="header-logo">
				<a class="logo ir" href="index.html" title="小米官网"> 小米官网 </a>
			</div>
			<div class="header-nav">
				<ul class="nav-list J_navMainList clearfix">
					<li id="J_navCategory" class="nav-category"><a
						class="link-category" href="#"> <span class="text">全部商品分类</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">小米手机</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">红米</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">电视</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">笔记本</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">空调</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">新品</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">路由器</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">智能硬件</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">服务</span>
					</a></li>
					<li class="nav-item"><a class="link" href="#"> <span
							class="text">社区</span>
					</a></li>
				</ul>
			</div>
			<div class="header-search">
				<form id="J_searchForm" class="search-form clearfix" action=""
					method="get">
					<input class="search-text" type="search" id="search" name="keyword"
						autocomplete="off" /> <input class="search-btn iconfont"
						type="submit" value="" />
					<div class="search-hot-words">
						<a href="#"> 小米8 </a> <a href="#"> 小米MIX 2S </a>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="page-main">
		<div class="container">
			<div class="buy-succ-box clearfix">
				<div class="goods-content" id="J_goodsBox">
					<div class="goods-img">
						<img src="img/shoppingcar/跳转时的.png" width="64" height="64">
					</div>
					<div class="goods-info">
						<h3>已成功加入购物车！</h3>
						<span class="name">小米 </span>
					</div>
				</div>

				<div class="actions J_actBox">
					<p class="hide J_notic">有商品未成功加入购物车，可以在购物车中查看</p>
					<a href="mi8pay.jsp" class="btn btn-line-gray J_goBack"> 返回上一级 </a> 
					<a href="shopping-car2.jsp" class="btn btn-primary" onclick = "doAjaxToShopCart()"> 去购物车结算 </a>
				</div>
			</div>
		</div>
	</div>
	<div class="site-footer container cleFloat">
		<div class="footer-service">
			<ul>
				<li><img src="img/sitefooter/weixiu.png" /> 预约维修服务</li>
				<li><img src="img/sitefooter/7天.png" /> 7天无理由退货</li>
				<li><img src="img/sitefooter/15天.png" /> 15天免费换货</li>
				<li><img src="img/sitefooter/包邮.png" /> 满150元包邮</li>
				<li><img src="img/sitefooter/定位.png" /> 520余家售后服务点</li>
			</ul>
		</div>
		<div class="footer-links">
			<dl>
				<dt>帮助中心</dt>
				<dd>
					<a>账户管理</a>
				</dd>
				<dd>
					<a>购物指南</a>
				</dd>
				<dd>
					<a>订单操作</a>
				</dd>
			</dl>
			<dl>
				<dt>服务支持</dt>
				<dd>
					<a>售后政策</a>
				</dd>
				<dd>
					<a>自助服务</a>
				</dd>
				<dd>
					<a>相关下载</a>
				</dd>
			</dl>
			<dl>
				<dt>线下门店</dt>
				<dd>
					<a>小米之家</a>
				</dd>
				<dd>
					<a>服务站点</a>
				</dd>
				<dd>
					<a>授权体验店</a>
				</dd>
			</dl>
			<dl>
				<dt>关于小米</dt>
				<dd>
					<a>了解小米</a>
				</dd>
				<dd>
					<a>加入小米</a>
				</dd>
				<dd>
					<a>投资者关系</a>
				</dd>
			</dl>
			<dl>
				<dt>关注我们</dt>
				<dd>
					<a>新浪微博</a>
				</dd>
				<dd>
					<a>官方微信</a>
				</dd>
				<dd>
					<a>联系我们</a>
				</dd>
			</dl>
			<dl>
				<dt>特色服务</dt>
				<dd>
					<a>F码通道</a>
				</dd>
				<dd>
					<a>礼物吗</a>
				</dd>
				<dd>
					<a>防伪查询</a>
				</dd>
			</dl>
			<div class="col-contact">
				<p>400-100-5678</p>
				<p>周一至周日 8:00-18:00</p>
				<p>（仅收市话费）</p>
				<div class="nofollow">
					<a>联系客服</a>
				</div>
			</div>
		</div>
	</div>
	<div class="site-info cleFloat">
		<div class="container">
			<div class="info-text">
				<p>
					<a>小米商城</a> <span>|</span> <a>MIUI</a> <span>|</span> <a>米家</a> <span>|</span>
					<a>米聊</a> <span>|</span> <a>多看</a> <span>|</span> <a>游戏</a> <span>|</span>
					<a>路由器</a> <span>|</span> <a>米粉卡</a> <span>|</span> <a>政企服务</a> <span>|</span>
					<a>小米天猫店</a> <span>|</span> <a>隐私政策</a> <span>|</span> <a>问题反馈</a>
					<span>|</span> <a>廉政举报</a> <span>|</span> <a>Select Region</a>
				</p>
				<p>
					@ <a>mi.com</a> 京ICP证110507号 <a>京ICP备10046444号</a> <a>京公网安备11010802020134号</a>
					<a>京网文[2017]1530-131号 </a> <br />
					违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试
				</p>

			</div>
			<div class="info-links">
				<img src="img/sitefooter/truste.png" /> <img
					src="img/sitefooter/v-logo-2.png" /> <img
					src="img/sitefooter/v-logo-1.png" /> <img
					src="img/sitefooter/v-logo-3.png" /> <img
					src="img/sitefooter/ba10428a4f9495ac310fd0b5e0cf8370.png" />
			</div>
		</div>
		<div class="slogan">
			<span>探索黑科技，小米为发烧而生！</span>
		</div>
	</div>

	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="js/index.js"></script>
	<script type="text/javascript">
	<script type="text/javascript">
		// 添加购物车成功，前往购物车，查询购物车信息
		function doAjaxToShopCart(){
			$.ajax({
				type:"post",
				url:"BuildOrderAction",
				async:false,//同步：意思是当有返回值以后才会进行后面的js程序。
				success:function(result){
					window.location.href = "shopping-car2.jsp";
				},
				error:function(result){
					alert("生成订单失败！");
				}
			});
		}
	</script>

</body>

</html>